{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "names = ['mike', 'marry', 'jack', 'joe', 'jiaxin', 'ethel']\n",
      "names_源文件 = ['mike', 'marry', 'jack', 'joe', 'jiaxin']\n"
     ]
    }
   ],
   "source": [
    "# 列表的复制\n",
    "#真正意义的复制\n",
    "#1.假复制   用 = 进行赋值  不要用等号复制列表\n",
    "# names = [\"mike\",\"marry\",\"jack\",\"joe\",\"jiaxin\"]\n",
    "# names_源文件 = names\n",
    "# names.append(\"ethel\")\n",
    "#\n",
    "# print(names_源文件)\n",
    "\n",
    "\n",
    "# 2.正确的复制\n",
    "names = [\"mike\",\"marry\",\"jack\",\"joe\",\"jiaxin\"]\n",
    "names_源文件 = names.copy()\n",
    "names.append(\"ethel\")\n",
    "print(\"names =\",names)\n",
    "print(\"names_源文件 =\",names_源文件)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
